{include file="public/head" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('v_global')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_system_manage')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_template')} {:lang('v_manage')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card">
                            <div class="card-body">
                                <form name="form_list" id="form_list" action="" method="post" class="table mb-3">
                                    <div class="row">
                                        <div class="col-md-12 mt-2 mb-3"><a href="{:url('/templatemanage/addtemplate',['lang'=>input('lang')])}" class="btn btn-success" data-target="#modal" data-toggle="modal"><i class="fa fa-plus-circle mr-1"></i>{:lang('v_add_default_template')}</a></div>
                                    </div>
                                    {empty name="list->data"}
                                        <div class="col-md-12 text-center">{:lang('v_nodata')}</div>
                                    {else /}
                                    <!--列表 开始-->
                                    <div class="row">
                                        {volist name='list->data' id='mulu'}
                                            <?php $muluArr = explode('.',$mulu); ?>
                                            <div class="col-md-3 col-sm-6 mb-5">
                                                <div class="position-relative shadow-sm border rounded px-3 py-3 text-center">
                                                    {if in_array($muluArr[0],$templateArray)}
                                                        <div class="row">
                                                            <div class="col-md-9 col-xs-8 px-2 text-left">
                                                                <span class="btn btn-default btn-xs mb-2 px-2 rounded disabled"><i class="fa fa-fw fa-ban mr-1"></i>{:lang('v_cannot_delete')}</span>
                                                            </div>
                                                            <div class="col-md-3 col-xs-4 px-2 text-right cursor usename">{:lang('v_using')}</div>
                                                        </div>
                                                        <div class="w-100 mt-2 mb-2"><div class="w-100 template"><img src="/skin/index/{$mulu}" class="w-100"></div></div>
                                                        <div class="w-100 text-center">{$muluArr[0]|msubstr=0,10}</div>
                                                    {else /}
                                                        <div class="row">
                                                            <div class="col-md-9 col-xs-8 px-2 text-left">
                                                                <span onClick="javascript:do_confirm('','','{:url('/templatemanage/delfile',['lang'=>$lang,'fromwhere'=>'first','mulu'=>input('mulu').'/'.$muluArr[0]])}','','');" class="btn btn-danger btn-xs mb-2 px-2 rounded"><i class="fas fa-trash mr-1"></i>{:lang('v_delete')}</span>
                                                            </div>
                                                            <label class="col-md-3 col-xs-4 px-2 text-right">
                                                                <input type="checkbox" name="selectid[]" id="selectid" value="{$Think.get.mulu}/{$muluArr[0]}">
                                                            </label>
                                                        </div>
                                                        <div class="w-100 mt-2 mb-2"><div class="template"><img class="w-100" src="/skin/index/{$mulu}"></div></div>
                                                        <div class="w-100 text-center">{$muluArr[0]|msubstr=0,10}</div>
                                                    {/if}
                                                    <div class="w-100 text-center">
                                                        <a class="btn btn-success btn-xs mt-2 mr-3 px-2 rounded" href="{:url('/templatemanage/skinlist',['lang'=>input('lang'),'mulu'=>'/'.$muluArr[0]])}"><i class="fa fa-fw fa-edit mr-1"></i>{:lang('v_edit')} {:lang('v_skin')}</a>
                                                        <a class="btn btn-info btn-xs mt-2 ml-3 px-2 rounded" href="{:url('/templatemanage/mululist',['lang'=>input('lang'),'mulu'=>'/'.$muluArr[0]])}"><i class="fa fa-fw fa-edit mr-1"></i>{:lang('v_edit')} {:lang('v_template')}</a>
                                                    </div>
                                                    <div class="clearfix"></div>
                                                </div>
                                            </div>
                                        {/volist}
                                    </div><div class="clearfix"></div>
                                    <div class="row">
                                        <div class="col-xl-6 mt-2"><div class="float-lg-left mr-4">{$list->render|raw}</div><div class="float-lg-left">{:lang('v_total')} {$list->page} / {$list->pageNum} {:lang('v_page')} {$list->total} {:lang('v_records')}</div></div>
                                        <div class="col-xl-6 mt-2 mt-md-1">
                                            <div class="float-left float-xl-right">
                                                <!-- 全选 -->
                                                <button type="button" class="btn btn-info mr-2 checkbox-toggle"><i class="far fa-fw fa-square mr-1"></i>{:lang('v_select_all')}</button>
                                                <!-- 真实删除 -->
                                                <button type="button" class="btn btn-danger" onClick="javascript:do_confirm('#form_list','','{:url('/templatemanage/delfile',['lang'=>$lang,'fromwhere'=>'first','deleteall'=>'yes'])}','','');"><i class="fa fa-fw fa-trash mr-1"></i>{:lang('v_delete_select')}</button>
                                            </div>
                                        </div>
                                    </div>
                                    <!--列表 结束-->
                                    {/empty}
                                    <div class="clearfix"></div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
<script type="text/javascript">
$('.usename').click(function(){
    var html = '{$use_name}';
    $('#modal_content').addClass('text-center');
    $('#modal_content').html(html);
    $("#modal").modal('show');
})
</script>
</body>
</html>